<?php

/**
 * entityimage actions.
 *
 * @package    Redsea20
 * @subpackage entityimage
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class entityimageActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
      $userid = 0;
      /**
       * IF PASSED PARAMETER IS NULL/0, THEN GET THE ID FROM SESSION
       */
      if($this->getRequestParameter('entityid') != null && $this->getRequestParameter('entityid') != '0')
      {
          $userid = $this->getRequestParameter('entityid');
      }
      else
      {
          $userid = $this->getUser()->getAttribute('currentuser')->getId();
      }

      $entityList = Doctrine_Core::getTable('Entity');
      $entity = $entityList->find($userid);
      //$entity = $entityList->find($this->getUser()->getAttribute('userid'));
    
      echo $entity["picture"];
      return sfView::NONE;
  }
}
